window.onload = function() {
	Opener();
}

function Opener() {
	var home= 'http://www.promosijualanku.co.cc/';
if(window.location!=home)
	{		
	var docWidth = $(document).width();
	var docHeight = $(document).height();
	var windowWidth = $(window).width();
	var windowHeight = $(window).height();
	document.documentElement.style.overflow = 'auto';
	document.body.scroll = "visible";
	$("a").each(function() {
	$(this).attr("hideFocus", "true").css("outline", "none");
	});
	$('#frontadbg, #terbaru, #allcatwrapper, #rowone ul li a img, #rowtwo ul li a img, #rowthree ul li a img, #midbannercov, #textpromo, #botcatwrapper').hide();
	}
else {
	var docWidth = $(document).width();
	var docHeight = $(document).height();
	var windowWidth = $(window).width();
	var windowHeight = $(window).height();
	var adcoreWidth = $(window).width()/2 - $("#frontadcore").outerWidth()/2;
	var adcoreHeight = $(window).height()/2 - $("#frontadcore").outerHeight()/2;
	document.documentElement.style.overflow = 'hidden';	
	document.body.scroll = "no";
	$("a").each(function() {
	$(this).attr("hideFocus", "true").css("outline", "none");
	});
	$('#frontadcore').hide();
	$('#singpagecov').hide();
	$("#frontad").css({
			"opacity": "0.8",
			"position": "absolute",
			"width": docWidth,
			"height": docHeight
		});
	$("#frontadcov").css({
			"opacity": "0.1",
			"position": "absolute",
			"width": windowWidth,
			"height": windowHeight
		});
	$("#frontadcore").css({
			"position": "absolute",			  
			"left": adcoreWidth,
			"top": adcoreHeight
		})
			frontadClose();
	}
};

function frontadClose() {
	$('#frontadcore').delay(2000).fadeIn('slow');
	$('.frontadHide').click(function() {
    $('#frontadbg').fadeOut('slow');
	setScroll();
    return false;
  	});
};

function setScroll() {
	document.documentElement.style.overflow = 'auto';
	document.body.scroll = "visible";
};   

//-------------------------------PopUp-------------------------------------//